<?php
/*if (!isset($_POST['email0'])) {
	header("HTTP\ 400 Bad Request");
	exit;
}*/
require_once 'db.inc.php';
$i = 0;
while (isset($_REQUEST['email'.$i++])) {
	$result = mysql_query("SELECT email FROM ".TABLE_PREFIX."users WHERE email = '".$_REQUEST['email'.($i - 1)]."'");
	if (mysql_num_rows($result) > 0) {
		echo mysql_result($result, 0, 'email');
		break;
	}
} 
?>